<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            position: absolute;
            width: 300px;
            height: 300px;
            border-radius: 50%;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            margin: auto;
            background: linear-gradient(to right, #fff 50%, #000 50%);
            border: 1px solid #000;
            animation: rotate 1s linear infinite;
        }

        div::before {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            content: "";
            width: 50px;
            height: 50px;
            background-color: #fff;
            border: 50px solid #000;
            border-radius: 50%;
        }

        div::after {
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            content: "";
            width: 50px;
            height: 50px;
            background-color: #000;
            border: 50px solid #fff;
            border-radius: 50%;
        }

        @keyframes rotate {
            0% {}

            100% {
                transform: rotate(-360deg);
            }
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>